feat(adventure): Add deck import/export and inventory management#10813
feat(adventure): Add deck import/export and inventory management#10813emirikol1 wants to merge 4 commits into
Conversation
…dventure mode Adds multi-format deck import (Arena, MTGO, native .dck), collection export in Arena format, and a mark-for-sale workflow. Available via both console commands and new UI buttons in the deck selection screen. Console commands: - load deck <path> Import deck, auto-give missing cards - load deck buy <path> Import deck, purchase missing cards with gold - check deck <path> Report which cards are missing - save deck <path> Export selected deck as .dck - export collection <path> Export full collection in Arena format - mark sell <path> Mark listed cards for auto-sell UI (DeckSelectScene): - Import Deck button with 3-mode dialog (free/buy/check-only) - Export Deck, Export Collection, Mark for Sale buttons Cross-platform file path handling (Unix/Mac/Windows) with ~ expansion. Co-authored-by: Cursor <cursoragent@cursor.com>
…raw string parsing PlayerFactoryUtil.addStaticAbility() crashed with ArrayIndexOutOfBoundsException when processing "Hexproof:Black" (2-part format) because it expected a 3-part "Hexproof:<validSource>:<description>" format. Now uses instanceof Hexproof pattern matching to access getValidType() and getTitle() directly, consistent with CardFactoryUtil's approach for card hexproof. Fixes crash when Veil of Summer resolves giving player hexproof from black/blue. Co-authored-by: Cursor <cursoragent@cursor.com>
|
what's the use case, is importing arbitrary decks really part of all normal gameplay...? |
|
The deck editor already supports importing decklists from the clipboard, though? Not to say there's no room to expand on what's already there, but why an entirely distinct importer?
How's it work on Android? |
…icing Add Adventure-specific dialogs and file picker, format-aware save names, mark-for-sale rollback, and buy-missing costs matching neutral-rep shops (getCardPrice × equipment discounts). Share cardShopBuyPrice with RewardScene. Co-authored-by: Cursor <cursoragent@cursor.com>
Use smaller height and scaled labels so file-op buttons match the compact deck list. Co-authored-by: Cursor <cursoragent@cursor.com>
|
You're right that this isn't core "normal" progression gameplay—it's optional tooling for people who want to try lists or manage collection/decks outside the usual loop. At worst it sits next to the F9 cheat/console side of Adventure ( It's a single-player adventure mode. There's no ranked play or prizes on the line—if someone doesn't want imports, cheats, or buy-missing, they can ignore the buttons and play straight. If they want to pull a deck from Goldfish/Arena, round-trip a collection through another app, or avoid dozens of console commands, this is for that. |
|
Why a separate importer instead of only clipboard in the deck editor? Clipboard import in the deck editor is still there for paste-while-editing. It can load a list into the deck you're editing, but it does not add those cards to your Adventure collection—you still don't own them for Adventure play. This adds a file-based path from the deck select screen (and console), plus export collection, export deck, and mark-for-sale from a list file. The main workflow is bringing in a full list from MTG Goldfish, Arena, or similar into your collection and a deck slot—not adding cards one-by-one in the deck editor (which copy/paste doesn't do for collection ownership), and not running a bunch of F9 console commands ( You can also export your collection (plaintext or Arena-style) to an external library/deck builder, build decks there, and re-import here. Parsing reuses Import modes (deck select, in order)
Export
Paths / Android Adventure uses Mark for sale: Pick a deck list; owned cards not in any deck (and not already marked) are flagged for auto-sell, with rollback to restore prior marked counts. |
tool4ever
left a comment
There was a problem hiding this comment.
Not sure all plane authors prefer if the intended gameplay experience can get messed up that easily, to me such default offerings kind of imply that the balance might be too screwed up without them 🤔
Tbh I think the original vision was not to reproduce quest mode with walking a map on top but more of a story-driven progression.
So wouldn't it make more sense to isolate such stuff cleanly in a sandbox mode than just "plastering" the GUI with cheat buttons? 🤷♂️
Above isn't meant as blocking, I'm mostly an observer on Adventure - though I can't recommend merging 2000+ lines of AI code without lots of manual cleanup...
|
Inclined to agree; the options to automatically buy and to automatically grant missing cards completely ignore intended progression and the limited availability of cards. Making them available through anything other than the dev console would suggest to the user that they're part of the intended way to play Adventure. If we wanted to accommodate people who want to cheat entire custom decks into adventure and don't want to manually add the cards, we may as well just add a cheat command that gives you a full collection and then let people use the regular importer. And if the existing import/export tools don't cover enough formats, it'd make more sense to broaden their functionality rather than implement them all over again. I'm not sure what the use case for marking the cards in an externally maintained deck list for sale is. |
|
Thanks for the comments. Let me think on it a bit. I have found it to be useful and fun, but I do see your points. I too wondered if maybe it should be stashed deeper than it is. Let me think on it. Out of curiosity, if it was callable just from the f9 menu would that fit better? I was on the fence about importing sell lists. That was a final thought and easily droppable. Happy to make adjustments to make it fit better. I do find the deck importer to be a big time saver for how I personally play. (I simply don’t have enough time to play the game purely as ‘intended’. I suppose alternatively I could build and release as a stand alone editor. I was hoping to make it so others like myself had access to some of the capabilities. Open to thoughts. |
Probably better than anywhere else in the application right now, though I think an external editor like you said might be more suitable for something of this scale. The dev console is primarily for quick tweaks and debugging rather than a full-fledged tool for customizing a game experience. |
Summary
Adds multi-format deck import (Arena, MTGO, native .dck), collection export in Arena format, mark-for-sale workflow, and a fix for Veil of Summer crashing the game.
Deck Import/Export (Adventure Mode)
Console Commands:
load deck <path>— Import deck, auto-give missing cards freeload deck buy <path>— Import deck, purchase missing cards with goldcheck deck <path>— Report which cards are missing without importingsave deck <path>— Export selected deck as native .dckexport collection <path>— Export full collection in Arena formatmark sell <path>— Mark listed cards for auto-sellUI (DeckSelectScene):
Technical Details:
~expansionDeckRecognizerfor Arena/MTGO format parsingBug Fix: Veil of Summer crash
PlayerFactoryUtil.addStaticAbility()crashed withArrayIndexOutOfBoundsExceptionwhen processingHexproof:Black(2-part format) because it expected a 3-part format. Fixed to useinstanceof Hexproofpattern matching and accessgetValidType()directly, consistent withCardFactoryUtil's approach for card hexproof.Files Changed
forge-gui-mobile/.../util/CardUtil.java— Import/export engineforge-gui-mobile/.../player/AdventurePlayer.java— Slot management helpersforge-gui-mobile/.../stage/ConsoleCommandInterpreter.java— 6 new commandsforge-gui-mobile/.../scene/DeckSelectScene.java— 4 new UI buttonsforge-game/.../player/PlayerFactoryUtil.java— Hexproof keyword fixTest Plan
Made with Cursor